const Koa=require('koa2');
const app=new Koa();
const body=require('koa-body');
const router=require('./router/router');
const cors = require('koa2-cors')

const https = require('https')
const fs = require('fs')

app.use(body({
    multipart:true,
    strict:false,
    formidable:{
        maxFileSize:200*1024*1024
    }
}))
app.use(router.routes(),router.allowedMethods());
// app.listen(2003);

app.use(cors())

let serv = https.createServer({
    cert: fs.readFileSync('./wx.original5.xyz.pem'),
    key: fs.readFileSync('./wx.original5.xyz.key'),
}, app.callback())

serv.listen(2002, '0.0.0.0');

// app.listen(2003, '0.0.0.0');
